<template>
  <div class="administratorlist">
    <List
      :userslist="adminlist"
      :titlearr="titlearr"
      :getuserslist="getadminlist"
      :userscount="admincount"
      :title="title"
    ></List>
  </div>
</template>
<script>
import { getadminall, getalladmin } from '@/api/list';

import List from '../components/List_admin.vue';
export default {
  components: {
    List,
  },
  data() {
    return {
      title: '管理员列表',
      adminlist: [],
      admincount: 0,
      titlearr: ['姓名', '注册日期', '地址', '权限'],
    };
  },
  methods: {
    async getadminlist(sss) {
      const res = await getadminall((sss-1)*10, 10);
      this.adminlist = res.data.data;
    // console.log(this.adminlist);
    },
    async getadmincount() {
      const res = await getalladmin();
      this.admincount = res.data.count;
    //   console.log(this.admincount);
    },
  },
  created() {
    this.getadminlist(1);
    this.getadmincount();
  },
};
</script>
<style lang="scss" scoped>
.administratorlist {
  width: 100%;
}
</style>
